package com.atguigu.order.config;

import com.atguigu.order.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author polaris
 * @date 2021/1/25 5:55 下午
 */
@Configuration
public class OrderWebConfig implements WebMvcConfigurer {
  @Resource
  LoginInterceptor loginInterceptor;

  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(loginInterceptor).addPathPatterns("/**");
  }
}
